import Vue from 'vue'
import Router from 'vue-router'
// 1.引入home组件
import Home from '@/page/home/Home'
import Location from '@/page/location/Location'
import Detail from '@/page/detail/Detail'
import detailGalary from '@/page/detail/components/detailGalary'
import mapContent from '@/page/detail/components/mapContent'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: Home  //2.配置home组件的路由
    },
    {
      path: '/location',
      component: Location  //配置Location组件路由
    },
    {
      path: '/detail/:id', //由于每个详情页的编号不同，所以使用动态路由
      component: Detail,  //配置Detail组件路由
      children:[ 
        { 
          path: 'galary',  //配置子路由 galary
          component: detailGalary
        },
        { 
          path: 'map',  //配置子路由map
          component: mapContent
        },
      ]

    },
  ]
})
